package com.dimaidt.girl.utils;

import com.dimaidt.girl.domain.Result;

/**
 * @author : Alex Hu
 * date : 2020/2/26 下午21:24
 * description :
 */
public class ResultUtil {
    public static Result success(Object object) {
        Result result = new Result();
        result.setCode(0);
        result.setMsg("执行成功");
        result.setData(object);
        return result;
    }

    public static Result success() {
        return success(null);
    }

    public static Result error(Integer code, String msg) {
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }
}
